/**
 * Created by wlc on 2018/5/13.
 */
/**
 * 暂停程序指定时间
 * @param delay
 */
function sleep(delay) {
    var start = new Date().getTime();
    while (new Date().getTime() < start + delay);
}

/**
 * 获取元素的纵坐标
 * @param e
 * @returns {number|Number}
 */
function getTop(e){
    var offset=e.offsetTop;
    if(e.offsetParent!==null) offset+=getTop(e.offsetParent);
    return offset;
}

/**
 * 获取元素的横坐标
 * @param e
 * @returns {Number|number}
 */
function getLeft(e){
    var offset=e.offsetLeft;
    if(e.offsetParent!==null) offset+=getLeft(e.offsetParent);
    return offset;
}